package com.share;

import com.share.annotate.Mapper;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.type.AnnotationMetadata;

/**
 * author:caifan
 * date:2019/9/3
 */
public class MyImportRegister implements ImportBeanDefinitionRegistrar {
    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
        AnnotationAttributes annotationAttributes = AnnotationAttributes.fromMap(importingClassMetadata.getAnnotationAttributes(Mapper.class.getName()));
        MyClassPathScanner scanner = new MyClassPathScanner(registry, false);
        scanner.registerDefaultFilters();
        scanner.doScan("com.share.mapper");


    }
}
